demos.Login = new Ext.form.FormPanel({   // KR needs to be form.FormPanel to have access to field values
	cls: 'login',                        // 'live'
    id: 'loginform',
    scroll: 'vertical',
    centered: true,
//    centered: true,
//    align: 'top',
    dockedItems: [{
        xtype: 'panel',
        layout: {
            type: 'vbox',
            pack: 'center',
            align: 'center'
        },
        id: 'logindock',
//        align: 'center',
        scroll: 'vertical',
        dock: 'top',
        items: [{
            xtype:	'fieldset',
        //    title:	'Login', // Docujot Login
            centered: true,
            id:		'loginarea',
            defaults: {
            	width: Ext.is.Phone ? 'fit' : 400,
				labelAlign: 'left',
	            labelWidth: '40%'
            },
            items: [{
                xtype: 	'textfield',
                name : 	'account',
                id:		'account',
                label: 	'Account',
                }, {
                xtype: 	'textfield',
                name : 	'username',
                id: 	'username',
                label: 	'Username',
                }, {
                xtype: 	'passwordfield',
                name : 	'password',
                id: 	'password',
                label: 	'Password',
            }],
    	}, {
            xtype:  'button',
            text:   'LOGIN',
            align:	'center',
            width:	200,
            height:	72,
            id:		'loginbutton',
            ui:     'confirm',
            handler: function(btn) {
            	var ui = sink.Main.ui;

            	if ((loginform.account.value == 'aha' || loginform.account.value == 'Aha')&& loginform.username.value != 'test' && loginform.password.value != '1234') {
            		//Ext.Msg.alert('Authenticated', 'You are in', Ext.emptyFn)
            		//sink.Main.ui.navigationButton.show(false);
            		ui.setActiveItem(demos.Maincontrol, 'slide');
            		ui.currentCard = demos.Maincontrol;
            		//ui.navigationButton.show();  turned off for live website 09/29/2011
            		
                    ui.addHxButton.show();
                    ui.saveButton.show();
            		ui.navigationBar.doLayout();
            		ui.doLayout();
        		} else {
            		Ext.Msg.alert('Failed', 'Username/password incorrect', Ext.emptyFn)            		
            	};
            }
        }]
    }]
});



// if (Ext.is.Android) {
//     demos.Forms.insert(0, {
//         xtype: 'component',
//         styleHtmlContent: true,
//         html: '<span style="color: red">Forms on Android are currently under development. We are working hard to improve this in upcoming releases.</span>'
//     });
// }